<%@ page import="java.io.* , java.util.*, java.sql.*, com.myapp.struts.dao.*,com.myapp.struts.actionform.*,com.myapp.struts.beans.*"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<html>
    <head>      
        <title>Item Master</title>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <link href="css/cms.css" rel="stylesheet" type="text/css"/>       
    </head>
    <body>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td height="550" align="center" valign="top" >                    
                    <html:form action="createItems" method="post">                   
                        <table width="674" border="0" align="center" cellpadding="0" cellspacing="0"
                               style="border-right: #000000 1px solid; border-top: #000000 1px solid; border-left: #000000 1px solid;  border-bottom: #000000 1px solid; font-size: 9pt; color: #000000; font-family: Arial;">
                            <tr>
                                <th height="30" colspan="5" align="center" valign="middle" ><span class="style13">Adding Items</span></th>
                            </tr>
                            <tr>
                                <td height="26" colspan="2" align="center" valign="middle"><strong>Material Type</strong></td>
                                <td colspan="3" align="center" valign="middle">
                                    <html:select property="itemType">
                                        <html:option value=""></html:option>
                                        <%
                                            MaterialMasterDao imdao = new MaterialMasterDao();
                                            Vector gp = imdao.getTypes();
                                            if (gp != null) {
                                                Iterator itg = gp.iterator();
                                                while (itg.hasNext()) {
                                                    MaterialFormBean gb = (MaterialFormBean) itg.next();
                                                    String pname = gb.getMaterialType();
                                        %>
                                        <html:option value="<%=pname%>"><%=pname%></html:option>
                                        <%}

                                    }%>
                                    </html:select>
                                </td>
                            </tr>
                            <tr align="center" valign="middle" >
                                <th width="144" height="27" ><span class="style17">Item code</span></th>
                                <th width="148" ><span class="style5 style18">Item Name </span></th>
                                <th width="144" ><span class="style5 style18">Quantity</span></th>
                                <th width="69" ><a href="uomMaster.jsp" target="_blank" class="style1">U.O.M</a></th>
                                <th width="167" ><span class="style5 style18">Rate</span></th>
                            </tr>
                            <tr >
                                <td colspan="5" align="center" valign="middle" ><div id="rrows">                                       
                                        <html:text property="itemCode"/>
                                        <html:text property="itemName"/>
                                        <html:text property="quantity"/>

                                        <html:select property="unitOfMeasurement">
                                            <html:option value="-1"></html:option>
                                            <%UomDao uomdao = new UomDao();
                                                Vector gp1 = uomdao.getAllUoms();
                                                if (gp1 != null) {
                                                    Iterator itg = gp1.iterator();
                                                    while (itg.hasNext()) {
                                                        UomBean gb = (UomBean) itg.next();
                                                String pname = gb.getUom();%>
                                            <html:option value="<%=pname%>"><%=pname%></html:option>
                                            <%}
                                        }%>
                                        </html:select>
                                        <html:text property="itemRate"/>                                    
                                    </div></td>
                            </tr>
                            <tr>
                                <td height="26" colspan="5" align="center" valign="middle"><label>
                                        <html:submit value="insert"/>                               
                                    </label></td>
                            </tr>
                        </table>
                    </html:form>
                    </td>
            </tr>
        </table>
    </body>
</html>
